import javax.swing.tree.TreeNode;
import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 17655
 * Date: 2025-05-05
 * Time: 16:07
 */
public class test3 {
    public List<Integer> inorderTraversal(TreeNode root) {
        List<Integer> ret = new ArrayList<>();
        inorder(root,ret);
        return ret;
    }

    public void inorder(TreeNode root,List<Integer> ret){
        if(root==null){
            return ;
        }
        inorder(root.left,ret);
        ret.add(root.val);
        inorder(root.right,ret);
    }
}
